Add permissions: {} to all reusable workflows#148114
Add permissions: {} to all reusable workflows#148114ezio-melotti merged 1 commit intopython:mainfrom
permissions: {} to all reusable workflows#148114Conversation
|
Thanks @ezio-melotti for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
|
Sorry, @ezio-melotti, I could not cleanly backport this to |
|
Sorry, @ezio-melotti, I could not cleanly backport this to |
|
GH-148115 is a backport of this pull request to the 3.14 branch. |
|
GH-148116 is a backport of this pull request to the 3.13 branch. |
|
Thanks @ezio-melotti for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10. |
|
Thanks @ezio-melotti for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11. |
|
Thanks @ezio-melotti for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
|
Sorry, @ezio-melotti, I could not cleanly backport this to |
|
Sorry, @ezio-melotti, I could not cleanly backport this to |
|
Sorry, @ezio-melotti, I could not cleanly backport this to |
|
GH-148122 is a backport of this pull request to the 3.12 branch. |
|
GH-148123 is a backport of this pull request to the 3.11 branch. |
Add permissions: {} to all reusable workflows
(cherry picked from commit 1f36a51)
|
Just a head-up that this breaks CI on private forks, I think (since now they can't read the repo anymore). |
|
Yep, the content privilege is implicit in public repos. It may make sense to have it everywhere with |
|
The motivation for this PR was to satisfy the CodeQL scanner, and make sure we have some at least ~minimal default at the top level. I think we're fine with using this everywhere: permissions:
contents: readIt does this:
https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#permissions |
|
Yep, that works! Do you want to fix it, or should I? |
|
I also wonder if that's a worthwhile CodeQL lint, or we should just disable it. |
I can probably do it tomorrow, but feel free to do it yourself before that :)
If only it was this simple :) It's something like this: for older orgs/repos, the default is permissive, with read/write for all scopes. Newer ones have a restricted default, read-only for And then there's forks... So explicit is good here. |
This PR explicitly adds
permissions: {}to all reusable workflows, solving a number of CodeQL issues.Technically, this is not strictly needed, since the reusable workflows inherits the permissions of the caller, however doing so has 3 advantages:
I also tightened the permissions of a few workflows that had
permissions: contents: read, and tested on my fork that everything still works fine.